package com.ztgf.shopping.mapper.shop;

import com.baomidou.mybatisplus.mapper.BaseMapper;
import com.ztgf.shopping.models.dto.shop.ShopCategoryRelationDTO;
import com.ztgf.shopping.models.vo.shop.ShopBrandMsgVO;
import com.ztgf.shopping.models.vo.shop.ShopCategoryVO;
import org.apache.ibatis.annotations.Param;

import java.math.BigDecimal;
import java.util.List;

/**
 * 店铺分类表映射
 *
 * @author zhanghualang
 * @Date 2020-05-28 14:42:59
 */
public interface ShopCategoryRelationMapper extends BaseMapper<ShopCategoryRelationDTO> {
    List<ShopCategoryVO> getCategoryByShopId(@Param("id") Long id);

    /*
     * @description:后台管理系统品牌详情获取关联店铺
     * @author: chenyu.wang
     * @date: 2020-09-21
     * @return:
     */
    List<ShopBrandMsgVO> queryBrandShopByBrandId(@Param(value = "brandId") Long brandId);

    /**
     * @description:批量修改店铺佣金
     * @author: liyang
     * @date: 2021-05-06
     * @return:
     * @param shopId
     * @param ids
     * @param dividendScaleRate
     */
    Integer updateShopDividendScale(@Param(value = "shopId") Long shopId, @Param(value = "ids") String ids, @Param(value = "dividendScaleRate") BigDecimal dividendScaleRate);

    Integer updateShopDividendScaleByCategory(@Param(value = "ids") String ids,@Param(value = "dividendScale") BigDecimal dividendScale);

    Integer updateShopDividendScaleByScheduled(@Param(value = "ids") String ids);

    ShopCategoryRelationDTO getCategoryByShopIdAndCommodityId(@Param(value = "shopId") Long shopId, @Param(value = "commodityId") Long commodityId);

}
